Hi folks, |
Re: About DRML If it's DRML digital content types files you're referring to then what are you wanting to do with them? Paul Miller Melbourne, Australia |
Re: About DRML SystemAdmin - Fri Mar 25 04:05:40 EDT 2011 Paul Miller Melbourne, Australia
Paul, <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <module baseline="Current" doors_version="DOORS 9.3.0.0"> <object has_inlinks="false" has_outlinks="false" modified="true"> <attribute name="Object Text" /> </object> <object has_inlinks="false" has_outlinks="false" modified="true"> <attribute name="Object Text"> <drml> <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> This is a test picture </drml> </attribute> </object> </module>
Attachments attachment_14632148_screenshot.JPG |
Re: About DRML Edward_Wang - Wed Jun 22 04:45:42 EDT 2011
Paul, <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <module baseline="Current" doors_version="DOORS 9.3.0.0"> <object has_inlinks="false" has_outlinks="false" modified="true"> <attribute name="Object Text" /> </object> <object has_inlinks="false" has_outlinks="false" modified="true"> <attribute name="Object Text"> <drml> <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> This is a test picture </drml> </attribute> </object> </module>
So what do you want to know? Yes there are Perms in DOORS 9.x for exporting the contents of an Object in DRML. The Rational Publishing Engine uses this method for exporting DOORS data. It is not documented (so probably IBM considers this a IBM-only feature). I think it might stand for "DOORS Requirement Markup Language", so a proprietary XML format. string drmlText (Buffer&, Column, Object, string, bool) string drmlText (Buffer&, Attr__, string, bool) string drmlText (Buffer&, Column, Object, string) string DRMLToRichText_ (Buffer&) string DRML (Attr__)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: About DRML Mathias Mamsch - Wed Jun 22 05:10:31 EDT 2011
So what do you want to know? Yes there are Perms in DOORS 9.x for exporting the contents of an Object in DRML. The Rational Publishing Engine uses this method for exporting DOORS data. It is not documented (so probably IBM considers this a IBM-only feature). I think it might stand for "DOORS Requirement Markup Language", so a proprietary XML format. string drmlText (Buffer&, Column, Object, string, bool) string drmlText (Buffer&, Attr__, string, bool) string drmlText (Buffer&, Column, Object, string) string DRMLToRichText_ (Buffer&) string DRML (Attr__)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Mathias, <attribute name="Object Text"> <drml> <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> <Picture> </drml> </attribute>
<attribute name="Object Text"> <drml> <Picture> <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> </drml> </attribute>
Attachments attachment_14632517_screenshot.JPG |
Re: About DRML Edward_Wang - Wed Jun 22 23:03:11 EDT 2011
Mathias, <attribute name="Object Text"> <drml> <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> <Picture> </drml> </attribute>
<attribute name="Object Text"> <drml> <Picture> <attachment ref="OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png" type="image/png" sv="0" width="1920" height="1200" /> </drml> </attribute>
What exporter do you use? Rational Publishing Engine light I figure? Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: About DRML Mathias Mamsch - Thu Jun 23 06:53:41 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Yes, I am a developer of Rational Publishing Engine. Well, it's a DRML issue, what should I do next? Raise a DRML defect or contact with DOORS dev team first? Could you give some advice? Thanks & Regards Edward |
Re: About DRML Edward_Wang - Thu Jun 23 22:54:59 EDT 2011 Did I get this right, you are a developer of the Rational Publishing Engine?? If so, you should simply modify it, so it will export attached pictures before the text of the object. If not ... well, I guess you would need a pretty bad hack to correct the problem manually in the DRML, before RPE consumes it ;-) Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: About DRML Mathias Mamsch - Fri Jun 24 03:34:46 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS. string drmlText (Buffer&, Column, Object, string, bool)
string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) {
string return = drmlTextOld (b,c,o,s,bl)
// ... postprocess the DRML here ...
return return
}
#include <RPE_hooked.inc>
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: About DRML Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011 Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS. string drmlText (Buffer&, Column, Object, string, bool)
string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) {
string return = drmlTextOld (b,c,o,s,bl)
// ... postprocess the DRML here ...
return return
}
#include <RPE_hooked.inc>
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: About DRML Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011 Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS. string drmlText (Buffer&, Column, Object, string, bool)
string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) {
string return = drmlTextOld (b,c,o,s,bl)
// ... postprocess the DRML here ...
return return
}
#include <RPE_hooked.inc>
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Mathias, string drmlText (Buffer&, Column, Object, string, bool) string drmlText (Buffer&, Attr__, string, bool) string drmlText (Buffer&, Column, Object, string) string DRMLToRichText_ (Buffer&) string DRML (Attr__)
|
Re: About DRML Edward_Wang - Sun Jun 26 23:34:03 EDT 2011
Mathias, string drmlText (Buffer&, Column, Object, string, bool) string drmlText (Buffer&, Attr__, string, bool) string drmlText (Buffer&, Column, Object, string) string DRMLToRichText_ (Buffer&) string DRML (Attr__)
I think you should just adapt the specific renderer to output the pictures at the end of the object. However there might be a problem that you cannot differentiate between pictures and OLEs so in this case you would need to rely on DOORS and DXL where the information, if the object has a picture is still there. string drmlText (Buffer &buf, Column col, Object obj, string dir, bool useSymbols) string drmlText (Buffer &buf, Attr__ ad, string dir, bool useSymbols)
Buffer buf = create(); buf = "<attribute name=\"Object Text\">
- <drml>
<attachment ref=\"OLE_4d969c0f1c616a6e_0000004b2Object_Text_.png\" type=\"image/png\" sv=\"0\" width=\"1920\" height=\"1200\" />
<Picture>
</drml>
</attribute>"
print "Before:\n\n" (tempStringOf buf) "\n"
// depending on the DOORS version you may want to use regexp2
Regexp reAttachment = regexp "[\n\r ]+<attachment ref=[^>]+/>"
Regexp reDRML = regexp "[\n\r ]+</drml>"
int indexStartAttachment = 0, indexEndAttachment = 0, indexDRML = 0
int dummy
if (search (reAttachment, buf,0) ) { // we have an attachment in here ...
indexEndAttachment = end 0
indexStartAttachment = start 0
if (search (reDRML, buf, 0)) {
indexDRML = start 0 // insert before the DRML closing tag
print "\n\nMoving Range " indexStartAttachment ":" indexEndAttachment " to " indexDRML "\n\n"
Buffer bufNew = create()
// first add everything before the attachment
combine(bufNew, buf, 0, indexStartAttachment-1)
// then add everything after the attachment till the DRML
combine(bufNew, buf, indexEndAttachment+1, indexDRML-1)
// then add the attachment
combine(bufNew, buf, indexStartAttachment, indexEndAttachment)
// then add the rest
combine(bufNew, buf, indexDRML)
// modifying the rpe_drmlText function is left as an exercise for the reader ...
print bufNew ""
} else {
print "Invalid DRML"
}
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: About DRML Mathias Mamsch - Fri Jun 24 03:44:43 EDT 2011 Regarding bad hacks: For example, if the Rational Publishing Engine uses a function, you could hook it. Imagine the Publishing engine would import a file called RPE.inc where the encrypted DXL source is located and that will call the following function to grab information from DOORS. string drmlText (Buffer&, Column, Object, string, bool)
string drmlTextOld (Buffer& b, Column c, Object o, string s, bool bl) { return drmlText (b,c,o,s,bl) }
string drmlText (Buffer& b, Column c, Object o, string s, bool bl) {
string return = drmlTextOld (b,c,o,s,bl)
// ... postprocess the DRML here ...
return return
}
#include <RPE_hooked.inc>
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Mathias,
//call rpe_drmlText() function from doorsperms.inc
rpe_drmlText(b,obj.parseString, strWorkDir, true, nonUnicodeFonts)
if(stringOf(b)!="<drml></drml>")
{
//write the drml result to xml
writeString(stringOf(b), false)
}
string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
//call DOORS drmlText() function
return drmlText(b, attr, dir, useSymbols)
}
|
Re: About DRML Edward_Wang - Fri Jul 01 02:05:13 EDT 2011
Mathias,
//call rpe_drmlText() function from doorsperms.inc
rpe_drmlText(b,obj.parseString, strWorkDir, true, nonUnicodeFonts)
if(stringOf(b)!="<drml></drml>")
{
//write the drml result to xml
writeString(stringOf(b), false)
}
string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
//call DOORS drmlText() function
return drmlText(b, attr, dir, useSymbols)
}
Heh. So finally I work for IBM ... Will you add a 'This product contains technology from Mathias Mamsch (IT-QBase) GmbH' somewhere in the 'Thank you to' part of the help file? ;-) Kidding ...
// depending on the DOORS version you may want to use regexp2
Regexp reAttachment = regexp "[\n\r ]+<attachment ref=[^>]+/>"
Regexp reDRML = regexp "[\n\r ]+</drml>"
void move_attachment (Buffer buf) {
int indexStartAttachment = 0, indexEndAttachment = 0, indexDRML = 0
int dummy
if (search (reAttachment, buf,0) ) { // we have an attachment in here ...
indexEndAttachment = end 0
indexStartAttachment = start 0
if (search (reDRML, buf, 0)) {
indexDRML = start 0 // insert before the DRML closing tag
// print "\n\nMoving Range " indexStartAttachment ":" indexEndAttachment " to " indexDRML "\n\n"
Buffer bufNew = create()
// first add everything before the attachment
combine(bufNew, buf, 0, indexStartAttachment-1)
// then add everything after the attachment till the DRML
combine(bufNew, buf, indexEndAttachment+1, indexDRML-1)
// then add the attachment
combine(bufNew, buf, indexStartAttachment, indexEndAttachment)
// then add the rest
combine(bufNew, buf, indexDRML)
// modifying the rpe_drmlText function is left as an exercise for the reader ...
setempty buf
combine(buf, bufNew,0)
delete bufNew
} else {
print "Warning: Invalid DRML:" (stringOf buf) "\n"
}
}
}
string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
//call DOORS drmlText() function, save return value
string ret = drmlText(b, attr, dir, useSymbols)
move_attachment b
return ret
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: About DRML Mathias Mamsch - Fri Jul 01 05:00:02 EDT 2011
Heh. So finally I work for IBM ... Will you add a 'This product contains technology from Mathias Mamsch (IT-QBase) GmbH' somewhere in the 'Thank you to' part of the help file? ;-) Kidding ...
// depending on the DOORS version you may want to use regexp2
Regexp reAttachment = regexp "[\n\r ]+<attachment ref=[^>]+/>"
Regexp reDRML = regexp "[\n\r ]+</drml>"
void move_attachment (Buffer buf) {
int indexStartAttachment = 0, indexEndAttachment = 0, indexDRML = 0
int dummy
if (search (reAttachment, buf,0) ) { // we have an attachment in here ...
indexEndAttachment = end 0
indexStartAttachment = start 0
if (search (reDRML, buf, 0)) {
indexDRML = start 0 // insert before the DRML closing tag
// print "\n\nMoving Range " indexStartAttachment ":" indexEndAttachment " to " indexDRML "\n\n"
Buffer bufNew = create()
// first add everything before the attachment
combine(bufNew, buf, 0, indexStartAttachment-1)
// then add everything after the attachment till the DRML
combine(bufNew, buf, indexEndAttachment+1, indexDRML-1)
// then add the attachment
combine(bufNew, buf, indexStartAttachment, indexEndAttachment)
// then add the rest
combine(bufNew, buf, indexDRML)
// modifying the rpe_drmlText function is left as an exercise for the reader ...
setempty buf
combine(buf, bufNew,0)
delete bufNew
} else {
print "Warning: Invalid DRML:" (stringOf buf) "\n"
}
}
}
string rpe_drmlText(Buffer& b, Attr__ attr, string dir, bool useSymbols, string nonUnicodeFonts)
{
//call DOORS drmlText() function, save return value
string ret = drmlText(b, attr, dir, useSymbols)
move_attachment b
return ret
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Thank you very much!! I tried to search your name in notes to send you a mail. Unfortunately, there are many people the same name with you. I'm not sure which one is the right person. Could you tell me your mailbox? We can discuss further by email. And a thanks letter is indeed necessary, because you really help me much. Edward |